home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJINC106.ARJ / STD.H < prev    next >
C/C++ Source or Header  |  1992-03-29  |  9KB  |  293 lines

  1. /* This is file std.h */
  2. /* This file may have been modified by DJ Delorie (Jan 1991).  If so,
  3. ** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave,
  4. ** Rochester NH, 03867-2954, USA.
  5. */
  6.  
  7. /* This may look like C code, but it is really -*- C++ -*- */
  8. /* 
  9. Copyright (C) 1988 Free Software Foundation
  10.     written by Doug Lea (dl@rocky.oswego.edu)
  11.  
  12. This file is part of GNU CC.
  13.  
  14. GNU CC is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY.  No author or distributor
  16. accepts responsibility to anyone for the consequences of using it
  17. or for whether it serves any particular purpose or works at all,
  18. unless he says so in writing.  Refer to the GNU CC General Public
  19. License for full details.
  20.  
  21. Everyone is granted permission to copy, modify and redistribute
  22. GNU CC, but only under the conditions described in the
  23. GNU CC General Public License.   A copy of this license is
  24. supposed to have been given to you along with GNU CC so you
  25. can know your rights and responsibilities.  It should be in a
  26. file named COPYING.  Among other things, the copyright notice
  27. and this notice must be preserved on all copies.  
  28. */
  29.  
  30.  
  31. #ifndef _std_h
  32. #define _std_h 1
  33.  
  34. #if 0
  35. #include <stddef.h> /* sorry, but needed for DGUX folks... */
  36. #include <stdio.h> /* sorry, but needed for USG folks... */
  37. #endif
  38.  
  39. #include <sys/types.h>
  40.  
  41. #ifndef offsetof
  42. #define offsetof(type,rec) ((int)(&(((type *)0)->rec)))
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. void volatile _exit(int);
  49. void volatile abort(void);
  50. int       abs(int);
  51. int       access(const char*, int);
  52. int       acct(const char*);
  53. unsigned  alarm(unsigned);
  54. int       atexit(void (*)(void));
  55. double    atof(const char*);
  56. int       atoi(const char*);
  57. long      atol(const char*);
  58. int       bind(int, void*, int);
  59. int       brk(void*);
  60. void *    bsearch (const void *, const void *, unsigned long, 
  61.                    unsigned long, int (*ptf)(const void*, const void*));
  62. void*     calloc(unsigned, unsigned);
  63. void      cfree(void*);
  64. int       chdir(const char*);
  65. int       chmod(const char*, int);
  66. int       chown(const char*, int, int);
  67. long      clock(void);
  68. int       close(int);
  69. #ifdef DGUX
  70. int       creat(char*, unsigned long int);
  71. #else
  72. int       creat(const char*, unsigned long int);
  73. #endif
  74. char*     crypt(const char*, const char*);
  75. char*     ctermid(char*);
  76. char*     cuserid(char*);
  77. double    drand48(void);
  78. int       dup(int);
  79. int       dup2(int, int);
  80. int       dysize(int);
  81. char*     ecvt(double, int, int*, int*);
  82. char*     encrypt(char*, int);
  83. double    erand(short*);
  84. int       execl(const char*, const char *, ...);
  85. int       execle(const char*, const char *, ...);
  86. int       execlp(const char*, const char*, ...);
  87. int       exect(const char*,  const char**,  char**);
  88. int       execv(const char*,  const char**);
  89. int       execve(const char*, const char**, char**);
  90. int       execvp(const char*,  const char**);
  91. void volatile exit(int);
  92. int       fchmod(int, int);
  93. int       fchown(int, int, int);
  94. int       fcntl(int, int, ...);
  95. char*     fcvt(double, int, int*, int*);
  96. int       ffs(int);
  97. int       flock(int, int);
  98. int       fork(void);
  99. void      free(void*);
  100. int       fsync(int);
  101. long      ftok(const char*, int);
  102. int       ftruncate(int, unsigned long);
  103. char*     gcvt(double, int, char*);
  104. char*     getcwd(char*, int);
  105. int       getdomainname(char*, int);
  106. int       getdtablesize(void);
  107. int       getegid(void);
  108. char*     getenv(const char*);
  109. int       geteuid(void);
  110. int       getgid(void);
  111. int       getgroups(int, int*);
  112. long      gethostid(void);
  113. int       gethostname(char*, int);
  114. char*     getlogin(void);
  115. /* int       getopt(int, char* const*, const char*); */
  116. int       getpagesize(void);
  117. char*     getpass(const char*);
  118. int       getpgrp();
  119. int       getpid(void);
  120. int       getppid(void);
  121. int       getpriority(int, int);
  122. int       getpw(int, char*);
  123. unsigned  getuid(void);
  124. char*     getwd(char*);
  125. char*     initstate(unsigned, char*, int);
  126. int       ioctl(int, int, char*);
  127. int       isatty(int);
  128. long      jrand48(short*);
  129. int       kill(int, int);
  130. int       killpg(int, int);
  131. void      lcong48(short*);
  132. int       link(const char*, const char*);
  133. int       listen(int, int);
  134. /* int       lock(int, int, long); */
  135. long      lrand48(void);
  136. long      lseek(int, long, int);
  137. void*     malloc(size_t);
  138. unsigned  malloc_usable_size(void*);
  139. void*     memalign(unsigned, unsigned);
  140. void*     memccpy(void*, const void*, int, int);
  141. void*     memchr(const void*, int, int);
  142. int       memcmp(const void*, const void*, size_t);
  143. void*     memcpy(void*, const void*, size_t);
  144. void*     _memcpy(void*, const void*, int); /* doesn't use movsb */
  145. void*     memset(void*, int, int);
  146. int       mkdir(const char*, int);
  147. int       mknod(const char*, int, int);
  148. int       mkstemp(char*);
  149. char*     mktemp(char*);
  150. long      mrand48(void);
  151. int       nice(int);
  152. long      nrand48(short*);
  153. #ifdef DGUX
  154. int       open(char*, int, ...);
  155. #else
  156. int       open(const char*, int, ...);
  157. #endif
  158. void volatile pause(void);
  159. void      perror(const char*);
  160. int       pipe(int*);
  161. int       profil(char*, int, int, int);
  162. void      psignal(unsigned, const char*);
  163. int       ptrace(int, int, int, int);
  164. int       putenv(const char*);
  165. void      qsort(void*, int, unsigned, int (*ptf)(void*,void*));
  166. int       rand(void);
  167. long      random(void);
  168. int       read(int, void*, unsigned);
  169. int       readlink(const char*, char*, int);
  170. void*     realloc(void*, unsigned);
  171. int       rename(const char*, const char*);
  172. int       rmdir(const char*);               
  173. void*     sbrk(int);              
  174. short*    seed48(short*);
  175. int       send(int, char*, int, int);
  176. int       setgid(int);
  177. int       sethostname(char*, int);
  178. int       setkey(const char*);
  179. int       setpgrp();
  180. int       setpriority(int, int, int);
  181. int       setregid(int, int);
  182. int       setreuid(int, int);
  183. char*     setstate(char*);
  184. int       setuid(int);
  185. int       sigblock(int);
  186. int       siginterrupt(int, int);
  187. int       sigpause(int);
  188. int       sigsetmask(int);
  189. unsigned  sleep(unsigned);
  190. int       socket(int, int, int);
  191. void      srand(int);
  192. void      srand48(long);
  193. void      srandom(int);
  194. int       stime(long*);
  195. char*     strcat(char*, const char*);
  196. char*     strchr(const char*, int);
  197. int       strcmp(const char*, const char*);
  198. char*     strcpy(char*, const char*);
  199. int       strcspn(const char*, const char*);
  200. char*     strdup(const char*);
  201. size_t    strlen(const char*);
  202. char*     strncat(char*, const char*, int);
  203. int       strncmp(const char*, const char*, int);
  204. char*     strncpy(char*, const char*, int);
  205. char*     strpbrk(const char*, const char*);
  206. char*     strrchr(const char*, int);
  207. int       strspn(const char*, const char*);
  208. char*     strstr(const char*, const char*);
  209. double    strtod(const char*, char**);
  210. char*     strtok(char*, const char*);
  211. long      strtol(const char*, char**, int);
  212. void      swab(void*, void*, int);
  213. int       symlink(const char*, const char*);
  214. int       syscall(int, ...);
  215. int       system(const char*);
  216. char*     tempnam(const char*, const char*);
  217. int       tgetent(char*, char*);
  218. int       tgetnum(char*);
  219. int       tgetflag(char*);
  220. char*     tgetstr(char *, char **);
  221. char*     tgoto(char*, int, int);
  222. unsigned long      time(unsigned long*);
  223. char*     tmpnam(char*);
  224. int       tputs(char *, int, int (*)());
  225. int       truncate(const char*, unsigned long);
  226. char*     ttyname(int);
  227. int       ttyslot(void);
  228. unsigned  ualarm(unsigned, unsigned);
  229. long      ulimit(int, long);
  230. int       umask(int);
  231. int       unlink(const char*);
  232. unsigned  usleep(unsigned);
  233. int       vadvise(int);
  234. void*     valloc(unsigned);
  235. int       vfork(void);
  236. int       vhangup(void);
  237. int       wait(int*);
  238. int       write(int, const void*, unsigned);
  239.  
  240. #ifdef __cplusplus
  241. }
  242. #endif
  243.  
  244.  
  245. #ifdef USG
  246. inline void  bzero(void* s, int l) { memset(s, 0, l); }
  247. inline void  bcopy(const void* s, void* d, int l) { memcpy(d, s, l); }
  248. inline int   bcmp(const void* s, const void* t, int l) {return memcmp(s,t,l);}
  249. inline char* index(const char* s, int c) { return strchr(s, c); }
  250. inline char* rindex(const char* s, int c) { return strrchr(s, c); }
  251. #else
  252. #ifdef __cplusplus
  253. extern "C" {
  254. #endif
  255. int       bcmp(const void*, const void*, int);
  256. void      bcopy(const void*, void*, int);
  257. void      _bcopy(const void*, void*, int); /* doesn't use movsb */
  258. void      bzero(void*, int);
  259. char*     index(const char*, int);
  260. char*     rindex(const char*, int);
  261. #ifdef __cplusplus
  262. }
  263. #endif
  264. #endif
  265.  
  266. extern char**   environ;
  267. extern volatile int errno;
  268. extern char*    sys_errlist[];
  269. extern int      sys_nerr;                  
  270. extern char*    optarg;
  271. extern int      opterr;
  272. extern int      optind;
  273.  
  274.  
  275. #ifndef __GNUC__
  276. #ifdef __cplusplus
  277. extern "C" {
  278. #endif
  279.  
  280. /* extern void* alloca(size_t); */
  281. #ifndef alloca
  282. #define alloca(x)  __builtin_alloca(x)
  283. #endif
  284. extern char *__builtin_alloca (int);
  285.  
  286. #ifdef __cplusplus
  287. }
  288. #endif
  289. #endif /* __GNUC__ */
  290.  
  291.  
  292. #endif 
  293.